﻿using Newtonsoft.Json;

namespace Core.Framework
{
    /// <summary>
    /// 方法返回值
    /// </summary>
    public class MethodResult
    {
        /// <summary>
        /// [真] 成功完成
        /// [假] 完成失败
        /// </summary>
        public bool IsFinished { get; set; }

        /// <summary>
        /// 结果信息
        /// </summary>
        public string Discription { get; set; }
    }

    public class MethodResult<T>
    {
        /// <summary>
        /// [真] 成功完成
        /// [假] 完成失败
        /// </summary>
        public bool IsFinished { get; set; }

        /// <summary>
        /// 结果信息
        /// </summary>
        public string Discription { get; set; }

        /// <summary>
        /// 结果数据
        /// </summary>
        public T Data { get; set; }

        /// <summary>
        /// 调试数据
        /// </summary>
        public object Debug { get; set; }
    }

    public class FunctionResult<T> : MethodResult<T>
    {
        /// <summary>
        /// 身份标识
        /// </summary>
        [JsonIgnore]
        //[JsonProperty]
        public string Channel { get; set; }

        /// <summary>
        /// 身份签名
        /// </summary>
        [JsonIgnore]
        public string Token { get; set; }

        /// <summary>
        /// Channel 变化
        /// </summary>
        [JsonIgnore]
        public bool IsChangeChannel { get; set; }

        [JsonIgnore]
        public double RunTimeTotalMilliseconds { get; set; }

        [JsonIgnore]
        public string ChannelParameter { get; set; }

        [JsonIgnore]
        public string ChannelSession { get; set; }

        /// <summary>
        /// 状态信息
        /// </summary>
        [JsonIgnore]
        public object State { get; set; }
        /// <summary>
        /// 是否写入状态信息
        /// </summary>
        [JsonIgnore]
        public bool IsWriteState { get; set; }

    }
}
